home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: sprintf() question
- Date: Sat, 30 Mar 96 21:08:21 GMT
- Organization: none
- Message-ID: <828220101snz@genesis.demon.co.uk>
- References: <31593522.76B3@cbm.com> <315C8C98.7FA7@olympic.net>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <315C8C98.7FA7@olympic.net>
- eanders@olympic.net "Erik W. Anderson" writes:
-
- >Maybe this is changing your question but if you're just working with
- >strings, why not use "strcpy" & "strcat"?
-
- Because they also invoke undefined behaviour when copying between
- overlapping objects. The answer is to use an extra buffer to ensure that
- the source and destination objects are distinct.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-